class Visit < ActiveRecord::Base
  belongs_to :enterprise
  belongs_to :visit_enterprise, :foreign_key => 'visit_enterprise_id', :class_name => 'Enterprise'
  belongs_to :visitor, :foreign_key => 'visitor_id', :class_name => 'User'

  validates :enterprise_id,
    :visit_enterprise_id,
    :visitor_id,
    :type_name,
    :presence => true
end
